from time import sleep
from selenium import webdriver

driver=webdriver.Chrome()
driver.get('https://www.baidu.com/')
el=driver.find_element_by_link_text('hao123')
jss="arguments[0].removeAttribute('target')"
ele=driver.find_element_by_link_text("hao123")
js="arguments[0].removeAttribute('target')"    #arguments[0]   代表javascript语句后,第一个参数
driver.execute_script(jss,el)   #把  selenium 元素定位   和  javascript语法进行结合
ele.click()



ele=driver.find_element_by_css_selector('[name="promote_start_date"]')
js="arguments[0].removeAttribute('readonly')"
driver.execute_script(js,ele)
ele.send_keys(Keys.CONTROL,'a')
ele.send_keys(Keys.CONTROL,'x')
ele.send_keys("2020-12-11")